<?php


class LiveComment extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'live_comment';
	}

	
	public function rules()
	{
		
		
		return array(
			array('comment, subscriber_id, live_channel_id, create_date', 'required'),
			array('subscriber_id, live_channel_id, live_channel_program_id, status', 'numerical', 'integerOnly'=>true),
			array('title', 'length', 'max'=>100),
			array('comment_note', 'safe'),
			
			
			array('id, title, comment, subscriber_id, live_channel_id, live_channel_program_id, create_date, status, comment_note', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'liveChannel' => array(self::BELONGS_TO, 'LiveChannel', 'live_channel_id'),
			'liveChannelProgram' => array(self::BELONGS_TO, 'LiveChannelProgram', 'live_channel_program_id'),
			'subscriber' => array(self::BELONGS_TO, 'Subscriber', 'subscriber_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'title' => 'Title',
			'comment' => 'Comment',
			'subscriber_id' => 'Subscriber',
			'live_channel_id' => 'Live Channel',
			'live_channel_program_id' => 'Live Channel Program',
			'create_date' => 'Create Date',
			'status' => 'Status',
			'comment_note' => 'Comment Note',
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('title',$this->title,true);
		$V0v5vsnfxezw->compare('comment',$this->comment,true);
		$V0v5vsnfxezw->compare('subscriber_id',$this->subscriber_id);
		$V0v5vsnfxezw->compare('live_channel_id',$this->live_channel_id);
		$V0v5vsnfxezw->compare('live_channel_program_id',$this->live_channel_program_id);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);
		$V0v5vsnfxezw->compare('status',$this->status);
		$V0v5vsnfxezw->compare('comment_note',$this->comment_note,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}